<link rel="stylesheet" href="../addons/jy_merch/css/mobile.css?v=6">

<div class='fui-page fui-page-current'>
    <div class="fui-header fui-header-success" style="background:{{main.syscolor||'#05c175'}}">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();"></a>
        </div>
        <div class="title">店铺设置</div>
        <div class="fui-header-right"></div>
    </div>
    <div class='fui-content'>
	<div style="padding:0.5rem">
        <div class="fui-list-group">
            <div class="fui-list">              
                <div class="fui-list-inner">
                    <div class="title">商城logo</div>
                </div>
				<a class="fui-list-media" ng-if="pagedata.post.logo">
					<img class="round" style="width: 3rem;height: 2.6rem;" src="{{tomedia(pagedata.post.logo) || '../core/resource/images/nopic.jpg'}}" />
				</a>
				<a class="fui-list-media weui_uploader_input_wrp">
					<span class="weui_uploader_input" ng-click="image(pagedata.post,'logo')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple=""></span>
				</a>
            </div>
			<div class="fui-list">              
                <div class="fui-list-inner">
                    <div class="title">店招</div>
                </div>
				<a class="fui-list-media" ng-if="pagedata.post.topimg">
					<img class="round" style="width: 3rem;height: 2.6rem;" src="{{tomedia(pagedata.post.topimg) || '../core/resource/images/nopic.jpg'}}" />
				</a>
				<a class="fui-list-media weui_uploader_input_wrp">
					<span class="weui_uploader_input" ng-click="image(pagedata.post,'topimg')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple=""></span>
				</a>
            </div>
        </div>
       <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">商户名称</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="merchname" placeholder="商户名称" ng-model="pagedata.post.merchname"/></div>
            </div>
            <div class="fui-cell">
                <div class="fui-cell-label">收款银行账户</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="收款银行账户" ng-model="pagedata.post.setting.bankcard"/></div>
            </div>
			<div class="fui-cell">
                <div class="fui-cell-label">账户名称</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="收款账户名称" ng-model="pagedata.post.setting.realname"/></div>
            </div>
			<div class="fui-cell">
                <div class="fui-cell-label">银行卡照片</div>
                <div class="fui-cell-info">
					<img style="width:5rem" ng-click="up_file(pagedata.post.setting,'bankimg','image')" accept="image/jpg,image/jpeg,image/png,image/gif" ng-src="{{tomedia(pagedata.post.setting.bankimg) ||'../addons/jy_weishop/resource/images/card04.png'}}" />
				</div>
            </div>
			<div ng-if="pagedata.jy_paimerch==1 || pagedata.jy_newpaimerch==1" class="fui-cell">
                <div class="fui-cell-label">商家让利%</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="商家让利%" ng-model="pagedata.post.setting.paifee"/></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">主营项目</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="例如鞋帽, 化妆品等" ng-model="pagedata.post.salecate"/></div>
            </div>
			<div class="fui-cell">
                <div class="fui-cell-label">商户类型</div>
				<div class="fui-cell-text">
					<select class="weui_select" style="padding:0.3rem" name="cateid2" ng-model="pagedata.post.merch_type">
                        <option ng-repeat="(key,title) in pagedata.newmerch_type" value="{{key}}">{{title}}</option>
					</select>
				 </div>
            </div>
			<div class="fui-cell">
                <div class="fui-cell-label">商户分类</div>
				<div class="fui-cell-text">
					<select class="weui_select" style="padding:0.3rem" name="cateid2" ng-model="pagedata.post.cateid">
                        <option ng-repeat="q in pagedata.newcates[pagedata.post.merch_type]" value="{{q.id}}">{{q.catename}}</option>
					</select>
				 </div>
            </div>
            <div class="fui-cell ">
                <div class="fui-cell-label">简单介绍</div>
                <div  class="fui-cell-info"><textarea id="desc" ng-model="pagedata.post.desc" placeholder="简单介绍下商户"></textarea></div>
            </div>
			<div class="fui-cell">
				<div class="fui-cell-label">
					营业时间
				</div>
				<div class="fui-cell-text">
					<select class="weui_select" style="padding:0.3rem" name="start" ng-model="pagedata.post.onlinetime.start">
						<option ng-repeat="value in pagedata.hoursoption" ng-selected="pagedata.post.onlinetime.start==value" value="{{value}}" >{{value}}</option>
					</select>
				</div>
				<div class="fui-cell-label" style="width:auto;padding:0.3rem">
					~
				</div>
				<div class="fui-cell-text">
					<select class="weui_select" style="padding:0.3rem" name="end" ng-model="pagedata.post.onlinetime.end">
                        <option ng-repeat="value in pagedata.hoursoption" ng-selected="pagedata.post.onlinetime.end==value" value="{{value}}" >{{value}}</option>
					</select>
				</div>
				
			</div>
			<div class="fui-cell">
					<div class="fui-cell-label">是否休息?</div>
					<div class="fui-cell-text">
						<input class="weui_switch" type="checkbox" ng-checked="pagedata.post.offline==1" ng-model="pagedata.post.offline">
					</div>
			</div>
			<div class="fui-cell">
					<div class="fui-cell-label">需要制作?</div>
					<div class="fui-cell-text">
						<input class="weui_switch" type="checkbox" ng-checked="pagedata.post.ismake==1" ng-model="pagedata.post.ismake">
					</div>
			</div>
			<div class="fui-cell-tip">开启后，商户有需要制作的过程，制作完成后，后台点发货，配送员才能接单！</div>
			<div class="fui-cell">
					<div class="fui-cell-label">自己配送?</div>
					<div class="fui-cell-text">
						<input class="weui_switch" type="checkbox" ng-checked="pagedata.post.mypeisong" ng-model="pagedata.post.mypeisong">
					</div>
			</div>
			<div ng-if="pagedata.post.mypeisong" class="fui-cell must ">
                <div class="fui-cell-label">配送费</div>
                <div class="fui-cell-info"><input type="text" class="fui-input"  placeholder="" ng-model="pagedata.post.out_pay"/></div>
            </div>
			<div ng-if="pagedata.post.mypeisong" class="fui-cell must ">
                <div class="fui-cell-label">起送金额</div>
                <div class="fui-cell-info"><input type="text" class="fui-input"  placeholder="" ng-model="pagedata.post.out_price"/></div>
            </div>
			<div ng-if="pagedata.post.mypeisong" class="fui-cell">
                <div class="fui-cell-label">满额免配送费</div>
                <div class="fui-cell-info"><input type="text" class="fui-input"  placeholder="" ng-model="pagedata.post.man_fee"/></div>
            </div>
        </div>
		<div class="fui-cell-group">
			<div class="fui-cell">
                <div class="fui-cell-label">营业执照/许可证</div>
                <div class="fui-cell-info">
					<div class="weui_uploader">
                        <div class="weui_uploader_bd" style="margin-bottom:0">
                            <ul class="weui_uploader_files">
                                <li ng-repeat="p in pagedata.post.codeimg" class="weui_uploader_file" style="background-image:url('{{tomedia(p)}}')">
									<div class="upbtn" >
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.post.codeimg.splice($index-1,0,p);pagedata.post.codeimg.splice($index+1,1)">上移</a>
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.post.codeimg.splice($index,1)">删除</a>
									</div>
								</li>
                            </ul>
                            <div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(pagedata.post,'codeimg')"></div>
                        </div>
                    </div>
				</div>
            </div>
        </div>
        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">联系人</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="realname" placeholder="您的称呼" ng-model="pagedata.post.realname"></div>
            </div>
            <div class="fui-cell must">
				<div class="fui-cell-label">手机号</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="请输入您的手机号"  ng-model="pagedata.post.mobile" /></div>
				<div ng-if="pagedata.pluginset.is_smscode==1" class="fui-cell-remark noremark"><a class="btn btn-default btn-default-o btn-sm" ng-click="tool.mobile_code(pagedata.post.mobile,'smscode')" id="smscode">获取验证码</a></div>
			</div>
			<div ng-if="pagedata.pluginset.is_smscode==1" class="fui-cell must ">
				<div class="fui-cell-label ">验证码</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="请输入验证码" ng-model="pagedata.post.smscode" /></div>
			</div>
            <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>

        </div>
		<div class="fui-cell-group">
			<div class="fui-cell">
				<div class="fui-cell-label ">所在城市</div>		
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.post.pcd.province" class="form-control tpl-province">
								<option value="" selected="selected">省份</option>
								<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="pagedata.post.pcd.province==value">{{value}}</option>
								</select>
							</div>
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.post.pcd.city" class="form-control tpl-city">
								<option value="" selected="selected">城市</option>
								<option ng-repeat="(value,data) in pagedata.province[pagedata.post.pcd.province]" value="{{value}}" ng-selected="pagedata.post.pcd.city==value">{{value}}</option>
								</select>
							</div>
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.post.pcd.district" class="form-control tpl-district">
								<option value="" selected="selected">区县</option>
								<option ng-repeat="(value,data) in pagedata.province[pagedata.post.pcd.province][pagedata.post.pcd.city]" value="{{value}}" ng-selected="pagedata.post.pcd.district==value">{{value}}</option>
								</select>
							</div>
							<div class="fui-cell-label" style="width:28%">
								<select ng-model="pagedata.post.pcd.street" class="form-control tpl-district">
								<option value="" selected="selected">街道</option>
								<option ng-repeat="value in pagedata.province[pagedata.post.pcd.province][pagedata.post.pcd.city][pagedata.post.pcd.district]" value="{{value}}" ng-selected="pagedata.post.pcd.street==value">{{value}}</option>
								</select>
							</div>
				
			</div>
			<div ng-if="pagedata.snslist.length>0" class="fui-cell">
                <div class="fui-cell-label">所属小区</div>
				<div class="fui-cell-text">
					<select class="weui_select" style="padding:0.3rem" name="cateid2" ng-model="pagedata.post.snsid">
                        <option ng-repeat="q in pagedata.snslist" value="{{q.id}}">{{q.title}}</option>
					</select>
				 </div>
            </div>
            <div class="fui-cell must">
                <div class="fui-cell-label">店铺地址</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="address" placeholder="店铺地址" ng-model="pagedata.post.addressinfo.address"></div>
				<div class="fui-cell-remark" ng-click="tool.choose_location(pagedata.post,'addressinfo')"><i class="icon jinyunicon icon-ditu"></i></div>
			</div>
        </div>
		<div ng-if="pagedata.post.diyfields.length>0" class="weui_cells_title">其他内容</div>
		<div ng-include="sys_html('common/_diyform',true)"></div>
        <div class="btn btn-success block" ng-click="post(pagedata.post,'post')" id="btn-submit">保存设置</div>
   
    </div>
 </div>
<script type="text/javascript">
scope.pagedata.post.addressinfo={'address':scope.pagedata.post.address,'lat_lng':scope.pagedata.post.lat_lng};
window.scope.location(function(res){
			console.log(res)
			scope.$evalAsync(function(){
				scope.pagedata.post.lat_lng=scope.pagedata.post.lat_lng?scope.pagedata.post.lat_lng:res.lat_lng
				scope.pagedata.post.address = res.address;
			});
});
scope.pagedata.hoursoption=[
	'01:00','02:00','03:00','04:00','05:00','06:00','07:00','08:00','09:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00','24:00'
];
</script>